﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:controls="clr-namespace:MMLib.WPF.CustomControls"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:converters="clr-namespace:MMLib.WPF.Converters">
    
    <converters:DateTimeToMessageCoverter x:Key="dateTimeToMessageCoverter" />
    
    <!-- Style for animated content control -->
    <Style TargetType="{x:Type controls:DateTimeMessageControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:DateTimeMessageControl}">
                    <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:DateTimeMessageControl}, Mode=FindAncestor}, 
                                              Path=DateTime, Converter={StaticResource ResourceKey=dateTimeToMessageCoverter}}"
                               Foreground="{TemplateBinding Foreground}"
                               FontSize="{TemplateBinding FontSize}"
                               FontFamily="{TemplateBinding FontFamily}"
                               FontWeight="{TemplateBinding FontWeight}"
                               />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>